package cn.wynu.ioc.base;

public class Student {
    String name;
    int age;

    // 重写toString，alt + insert、或者右键generate
    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    void initA() {
        System.out.println("这是一个初始化函数");
    }

    void destroyB() {
        System.out.println("这是一个销毁函数");
    }

    // 空参构造函数
    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
